package Tests;

import java.awt.Point;
import javax.swing.tree.DefaultMutableTreeNode;
import robotlion.model.Carte;
import robotlion.model.Case;
import robotlion.pathfinding.PathfindingDijkstra;

/**
 *
 * @author test
 */
public class TestPathfinding {

    public static void main(String[] args) {
        
        // Définition d'une carte en dur
        Case[][] tableau = {{new Case(1),new Case(1),new Case(1)},
                            {new Case(1),new Case(1),new Case(1)},
                            {new Case(1),new Case(1),new Case(1)}};
        
        Carte carte = new Carte(tableau);
        
        PathfindingDijkstra algoDePathfinding = new PathfindingDijkstra(carte);
        
        //algoDePathfinding.pointLePlusProche(new DefaultMutableTreeNode(new Point (1,0)), Integer.MAX_VALUE);
        
        // Test de dijkstra sans accessibilité maximale
        /*algoDePathfinding.dijkstra
                (new DefaultMutableTreeNode(new Point(0, 0)), new Point(2, 2), 
                Integer.MAX_VALUE, 0, true);*/
        
        // Test de dijkstra avec accessibilité max de 50 <=>
        // le chemin choisi par le robot ne sera pas le meme !
        algoDePathfinding.dijkstra
                (new DefaultMutableTreeNode(new Point(0, 0)), new Point(2, 0), 
                50, 0, true);
        
        System.out.println(algoDePathfinding.getLastPoidsCumule());
        
        // Quelques tests complémentaires
        /*algoDePathfinding.dijkstra
                (new DefaultMutableTreeNode(new Point(2, 0)), new Point(0, 2), 
                Integer.MAX_VALUE, 0, true);*/
        
        /*algoDePathfinding.dijkstra
                (new DefaultMutableTreeNode(new Point(2, 2)), new Point(0, 0), 
                Integer.MAX_VALUE, 0, true);*/
    }
}
